{include file="public/header" /}
<style>
    .flex-layout input{
        height: 30px;
        line-height: 30px;
        text-align: right;
        padding-right: 5px;
    }
    .layui-form-danger:focus {
        box-shadow: 0 0 0 2px var(--bc);
    }
    .buyout{
        position: fixed;
        line-height: 45px;
        text-align: center;
        color: var(--cl);
        font-size: 15px;
        bottom: 15px;
        width: 80%;
        left: 10%;
        height: 45px;
        border-radius: 20px;
        background: linear-gradient(to right ,rgb(254,129,1), rgb(235,29,35));
    }
    .header{
        position: static !important;
    }
</style>
<body class="hide-top bgc">
    {if !$Request.param.id}
    <div class="header">
        <span class="layui-icon layui-icon-left" onclick="load_href('{:url(\'user/index\')}',2)"></span> 我的交易
    </div>
    <ul class="pro-list-nav-top">
        <li data-type="1" class="active">
            <div>买单</div>
            <p></p>
        </li>
        <li data-type="2">
            <div>卖单</div>
            <p></p>
        </li>
    </ul>
    {/if}
    <div class="draw-container" {if !$Request.param.id} style="margin-top: 20px;" {/if}>
        <img src="/static/index/img/icon16.png" alt="">
        <div class="draw-content">
            <form action="{:url('deal/add')}" method="post" class="form layui-form">
                <div class="draw-account">
                    <div>
                        <p class="price"><span id="zh1">可出售余额</span></p>
                        <p class="num">￥<span id="zhanghu">{$user.assets.sold}</span></p>
                    </div>

                </div>
                <div class="draw-account-news">
                    <input type="hidden" name="id" value="{$Request.param.id?:''}"/>
                    <input type="hidden" name="type" id="types" value="{$Request.param.type?:1}"/>
                    <div class="flex-layout">交易单价
                        <input type="text" lay-verify="required" lay-reqtext="请输入交易单价" value="{$buy_money}" lay-verType="tips"
                               name="price" placeholder="请输入交易单价" readonly>
                    </div>
                    <div class="flex-layout">交易数量
                        <input type="nember" lay-verify="required" lay-reqtext="请输入交易数量" lay-verType="tips"
                               name="num" placeholder="请输入交易数量" >
                    </div>
                    <div class="flex-layout">支付密码
                        <input type="password" lay-verify="required" lay-reqtext="请输入支付密码" lay-verType="tips"
                               name="pay_password" placeholder="请输入支付密码" >
                    </div>
                </div>
                <p class="buyout" lay-submit lay-filter="save" formObj=".form">{$Request.param.id?($Request.param.type==1?"卖出":"买入"):"发布交易"}</p>
            </form>
        </div>
    </div>
</body>
{include file="public/footer"/}
<script>
     $('.pro-list-nav-top li').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        $("#types").val($(this).attr('data-type'));
    });
</script>
</html>